﻿@model InVision_Ticket.ViewModels.TicketViewModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Create</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src= "@Url.Content("~/Scripts/MarkdownDeepLib.min.js")" type="text/javascript"></script>
    <link href="../../Content/mdd_styles.css" rel="stylesheet" type="text/css" />

</head>
<body>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Create a new ticket</legend>
        @Html.HiddenFor(model => model.CustomerContactID)
        @Html.HiddenFor(model => model.CustomerID)
            <div id="NewSystemDiv">
                <fieldset>
                    <legend>System Information</legend>

                    <div class="editor-label">
                        @Html.LabelFor(model => model.System.Type)
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.System.Type)
                        @Html.ValidationMessageFor(model => model.System.Type)
                    </div>       
                    <div class="editor-label">
                        @Html.LabelFor(model => model.System.Desciption)
                    </div>
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.System.Desciption)
                        @Html.ValidationMessageFor(model => model.System.Desciption)
                    </div>
                </fieldset>
            </div>
            
            <fieldset>
                <legend>Issue Description</legend>
                <div class="editor-label ClearBoth">
                    @Html.LabelFor(model => model.Summary)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Summary)
                    @Html.ValidationMessageFor(model => model.Summary)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.Details)
                </div>

                    <div class="editor-field">
                        <div class="mdd_toolbar" id="details_toolbar"></div>
                        @Html.TextAreaFor(model => model.DetailsMarkDown, new { @class = "mdd_editor", @id = "details_textarea" })
		                <div class="mdd_resizer" id="details_resizer"></div>
                        <div class="mdd_preview" id="details_preview">@Model.Details</div>
                    </div>
@*
                <div class="editor-label">
                    @Html.LabelFor(model => model.Priority)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Priority)
                    @Html.ValidationMessageFor(model => model.Priority)
                </div>*@

                <div class="editor-label">
                    @Html.LabelFor(model => model.TicketType)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.TicketTypeID, new SelectList(Model.TicketTypeList, "TicketTypeID", "TicketType1"))
                    @Html.ValidationMessageFor(model => model.TicketType)
                </div>
                <div class="editor-label">
                    @Html.LabelFor(model => model.Location)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.Location.LocationID, new SelectList(Model.LocationList, "LocationID", "StoreLocation"))
                    @Html.ValidationMessageFor(model => model.Location.LocationID)
                </div>
              
            </fieldset>
        <p>
            <input type="submit" value="Create" />
        </p>


    </fieldset>
}
</body>
</html>


<script type="text/javascript">
    $("textarea.mdd_editor").MarkdownDeep({
        help_location: "~/Content/mdd_help.html",

    });
    $("#details_textarea").css("display", "block");
    $("#details_resizer").css("display", "block");
    $("#details_toolbar").css("display", "block");
</script>